package pers.sen.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import pers.sen.cloud.po.User;
import pers.sen.cloud.service.UserService;

/**
 * @author Jason
 * @version 1.0.0
 * @date 2020/11/26 19:57
 * @Description TODO
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/user/{username}")
    public User findByUsername(@PathVariable String username) {
        System.out.println("被访问的User节点：=========" + port);
        return userService.findByUsername(username);
    }
}
